#include "user.h"

int main()
{
	int fd_public;
	client_num=0;
	creat_fifo(Public);
	while(1)
	{
		if((fd_public=open(Public,O_RDONLY))<0)
		{
			printf("failed to open server fifo\n");
			exit(1);
		}
		if((read(fd_public,&server_packet,sizeof(struct packet)))>0)
		{
			printf("it is client%d sending",client_num);
			server_send_data();
		}
		else
		{
			printf("read failed\n");
			exit(1);
		}
		if(client_num==0)
		{
			exit(1);
		}
	}
	return 0;

}
